{extend name="../../admin/view/main"}

{block name="button"}

<!--{if auth("add")}-->
<button class='layui-btn layui-btn-sm layui-btn-primary' data-modal='{:url("add")}'>添加品质问题</button>
<!--{/if}-->

{/block}

{block name='content'}
<div class="think-box-shadow">
    {include file='rework/rework_question/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class="text-left nowrap">ID</th>
            <th class="text-left nowrap">题目</th>
            <th class="text-left nowrap" colspan="4">选项</th>
            <th class="text-left nowrap">状态</th>
            <th class="text-left nowrap">操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class="text-left nowrap">{$vo.id|default=''}</td>
            <td class="text-left nowrap">{$vo.title|default=''}</td>

            <td class="text-left nowrap {if $vo.is_answer_a eq 1}color-green{/if}">{$vo.answer_a}</td>
            <td class="text-left nowrap {if $vo.is_answer_b eq 1}color-green{/if}">{$vo.answer_b}</td>
            <td class="text-left nowrap {if $vo.is_answer_c eq 1}color-green{/if}">{$vo.answer_c}</td>
            <td class="text-left nowrap {if $vo.is_answer_d eq 1}color-green{/if}">{$vo.answer_d}</td>

            <td class="text-left nowrap">
                {if $vo.state eq 0}<span class="color-red">禁用</span>
                {elseif $vo.state eq 1}<span class="color-green">启用</span>
                {/if}
            </td>

            <td class='text-left nowrap'>

                <!--{if auth("edit")}-->
                <a class="layui-btn layui-btn-sm" data-dbclick data-modal="{:url('edit')}?id={$vo.id}" data-title="编辑品质问题">编 辑</a>
                <!--{/if}-->

                <!--{if auth("remove")}-->
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('remove')}" data-confirm="确定要删除该品质问题吗？" data-value="id#{$vo.id}">删 除</a>
                <!--{/if}-->

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}